//
//  OMTAsset.h
//  OMTImagePicker
//
//  Created by yizhaorong on 2017/11/15.
//

#import <Foundation/Foundation.h>
#import <Photos/Photos.h>

@class OMTAlbumManager;

// 照片选中状态改变
FOUNDATION_EXPORT NSString *const OMTAssetAssetSelectedStateChangedNotification;
// 照片类型改变
FOUNDATION_EXPORT NSString *const OMTAssetAssetTypeChangedNotification;

typedef NS_ENUM(NSUInteger, OMTAssetMediaType) {
    OMTAssetMediaTypeUnknown = 0,
    OMTAssetMediaTypePhoto = 1,
    OMTAssetMediaTypeVideo = 2,
    OMTAssetMediaTypeAudio = 3,
    OMTAssetMediaTypeLivePhoto = 4,
};

@interface OMTAsset : NSObject
// PHAsset 或 ALAsset
@property(nonatomic, strong) PHAsset *asset;
// 是否选中
@property(nonatomic, assign, getter=isSelected) BOOL selected;
// 类型
@property (nonatomic, assign) OMTAssetMediaType mediaType;
// 时长(视频才有)
@property (nonatomic, copy) NSString *duration;
// 是否为GIF
@property (nonatomic, assign, getter=isGIF) BOOL GIF;
// 视频URL
@property (nonatomic, strong) NSURL *url;
// 相册管理器
@property (nonatomic, weak) OMTAlbumManager *albumManager;

+ (instancetype)asset:(id)asset mediaType:(OMTAssetMediaType)mediaType duration:(NSString *)duration;

@end
